package com.huawei.hwid.core.datatype;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.text.TextUtils;
import com.huawei.hwid.core.constants.HwAccountConstants;

public class HwAccount implements Parcelable {
    public static final Creator<HwAccount> CREATOR = new Creator<HwAccount>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return a(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return a(i);
        }

        public HwAccount a(Parcel parcel) {
            HwAccount hwAccount = new HwAccount();
            hwAccount.a = parcel.readString();
            hwAccount.b = parcel.readString();
            hwAccount.c = parcel.readString();
            hwAccount.d = parcel.readString();
            hwAccount.e = parcel.readInt();
            hwAccount.f = parcel.readString();
            hwAccount.g = parcel.readString();
            hwAccount.h = parcel.readString();
            hwAccount.i = parcel.readString();
            hwAccount.j = parcel.readString();
            hwAccount.k = parcel.readString();
            hwAccount.l = parcel.readString();
            hwAccount.m = parcel.readString();
            hwAccount.n = parcel.readString();
            hwAccount.o = parcel.readString();
            hwAccount.p = parcel.readString();
            hwAccount.q = parcel.readString();
            hwAccount.r = parcel.readString();
            return hwAccount;
        }

        public HwAccount[] a(int i) {
            return new HwAccount[i];
        }
    };
    private String a;
    private String b;
    private String c;
    private String d;
    private int e = 0;
    private String f;
    private String g;
    private String h;
    private String i;
    private String j;
    private String k = "";
    private String l;
    private String m;
    private String n;
    private String o;
    private String p;
    private String q;
    private String r;

    public String a() {
        return this.l;
    }

    public void a(String str) {
        this.l = str;
    }

    public String b() {
        return this.c;
    }

    public void b(String str) {
        this.c = str;
    }

    public String c() {
        return this.a;
    }

    public void c(String str) {
        this.a = str;
    }

    public String d() {
        return this.d;
    }

    public void d(String str) {
        this.d = str;
    }

    public int e() {
        return this.e;
    }

    public void a(int i) {
        this.e = i;
    }

    public String f() {
        return this.f;
    }

    public void e(String str) {
        this.f = str;
    }

    public String g() {
        return this.b;
    }

    public void f(String str) {
        this.b = str;
    }

    public String h() {
        return this.j;
    }

    public void g(String str) {
        this.j = str;
    }

    public String i() {
        return this.g;
    }

    public void h(String str) {
        this.g = str;
    }

    public String j() {
        return this.h;
    }

    public void i(String str) {
        this.h = str;
    }

    public String k() {
        return this.i;
    }

    public void j(String str) {
        this.i = str;
    }

    public String l() {
        return this.k;
    }

    public void k(String str) {
        this.k = str;
    }

    public String m() {
        if (TextUtils.isEmpty(this.m)) {
            this.m = "0";
        }
        return this.m;
    }

    public void l(String str) {
        this.m = str;
    }

    public String n() {
        if (TextUtils.isEmpty(this.n)) {
            return "";
        }
        return this.n;
    }

    public void m(String str) {
        this.n = str;
    }

    public String o() {
        return this.p;
    }

    public void n(String str) {
        this.p = str;
    }

    public String p() {
        return this.q;
    }

    public void o(String str) {
        this.q = str;
    }

    public String q() {
        return this.o;
    }

    public void p(String str) {
        this.o = str;
    }

    public String r() {
        if (this.r == null) {
            return "0";
        }
        return this.r;
    }

    public void q(String str) {
        this.r = str;
    }

    public String toString() {
        return "HwAccount";
    }

    public Bundle s() {
        Bundle bundle = new Bundle();
        bundle.putString("requestTokenType", c());
        bundle.putString("serviceToken", g());
        bundle.putString("accountName", b());
        bundle.putString("userId", d());
        bundle.putInt("siteId", e());
        bundle.putString(HwAccountConstants.EXTRA_COOKIE, f());
        bundle.putString("deviceId", i());
        bundle.putString("subDeviceId", j());
        bundle.putString("deviceType", k());
        bundle.putString("accountType", h());
        this.k = l();
        if (TextUtils.isEmpty(this.k)) {
            this.k = b();
        }
        bundle.putString("loginUserName", this.k);
        bundle.putString("countryIsoCode", a());
        bundle.putString("STValidStatus", m());
        bundle.putString("serviceCountryCode", n());
        bundle.putString("uuid", q());
        bundle.putString(HwAccountConstants.EXTRA_AS_SERVER_DOMAIN, o());
        bundle.putString(HwAccountConstants.EXTRA_CAS_SERVER_DOMAIN, p());
        bundle.putString(HwAccountConstants.EXTRA_LASTUPPDATETIME, r());
        return bundle;
    }

    public Bundle t() {
        Bundle s = s();
        s.remove(HwAccountConstants.EXTRA_COOKIE);
        return s;
    }

    public HwAccount a(Bundle bundle) {
        c(bundle.getString("requestTokenType"));
        f(bundle.getString("serviceToken"));
        b(bundle.getString("accountName"));
        d(bundle.getString("userId"));
        a(bundle.getInt("siteId"));
        e(bundle.getString(HwAccountConstants.EXTRA_COOKIE));
        h(bundle.getString("deviceId"));
        i(bundle.getString("subDeviceId"));
        j(bundle.getString("deviceType"));
        g(bundle.getString("accountType"));
        k(bundle.getString("loginUserName"));
        a(bundle.getString("countryIsoCode"));
        l(bundle.getString("STValidStatus"));
        m(bundle.getString("serviceCountryCode"));
        p(bundle.getString("uuid"));
        n(bundle.getString(HwAccountConstants.EXTRA_AS_SERVER_DOMAIN));
        o(bundle.getString(HwAccountConstants.EXTRA_CAS_SERVER_DOMAIN));
        q(bundle.getString(HwAccountConstants.EXTRA_LASTUPPDATETIME));
        return this;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.a);
        parcel.writeString(this.b);
        parcel.writeString(this.c);
        parcel.writeString(this.d);
        parcel.writeInt(this.e);
        parcel.writeString(this.f);
        parcel.writeString(this.g);
        parcel.writeString(this.h);
        parcel.writeString(this.i);
        parcel.writeString(this.j);
        parcel.writeString(this.k);
        parcel.writeString(this.l);
        parcel.writeString(this.m);
        parcel.writeString(this.n);
        parcel.writeString(this.o);
        parcel.writeString(this.p);
        parcel.writeString(this.q);
        parcel.writeString(this.r);
    }
}
